﻿using System;

namespace Entities
{
    [Serializable]
    public class tblProductOptionValue
    {
        private int product_option_id;
        private int product_id;
        private int quantity;
        private int price;

        public tblProductOptionValue() { }

        public tblProductOptionValue(int product_option_id, int product_id, int quantity, int price)
        {
            this.product_option_id = product_option_id;
            this.product_id = product_id;
            this.quantity = quantity;
            this.price = price;
        }

        public int productOptionID
        {
            get { return this.product_option_id; }
            set
            {
                if (value == null)
                    throw new Exception("Mă thông số sản phẩm không được để trống!");
                this.product_option_id = value;
            }
        }

        public int productID
        {
            get { return this.product_id; }
            set
            {
                if (value == null)
                    throw new Exception("Mă sản phẩm không được để trống!");
                this.product_id = value;
            }
        }

        public int Quantity
        {
            get { return this.quantity; }
            set
            {
                this.quantity = value;
            }
        }

        public int Price
        {
            get { return this.price; }
            set
            {
                this.price = value;
            }
        }

        public override string ToString()
        {
            return this.product_option_id + "; " + this.product_id + "; " + this.quantity+"; "+this.price+"; ";
	    }
	    public override bool Equals(Object obj)
	    {
            tblProductOptionValue me = (tblProductOptionValue)obj;
            bool ret = this.productOptionID.Equals(me.productOptionID);
	        return ret;
	    }
	    public override int GetHashCode()
	    {
            return this.productOptionID.GetHashCode();
	    }

    }
}
